#pragma once

#include <string>
#include <termios.h>

class SerCom
{
public:
    static SerCom * get();

    void write( const char *msg, int len );

    void write( std::string &msg );

    std::string read();

    void close();

    bool init( const char *ttystr );

private:
    SerCom() {}

    static SerCom *s_instance;

    int m_usb;

    struct termios m_oldTty;
};
